package com.sina.interfaces.core.web;


import javax.validation.constraints.Pattern;

import static com.sina.interfaces.core.util.JsonUtils.writeToJson;

/**
 * <p>
 * </p>
 *
 * @version 1.0
 */
public class Form {


    @Pattern(regexp = "^json|html|xml$", message = "content must be one of [json,html,xml]")
    protected String content;


    public Form() {

    }

    public String getContent() {
        return content;
    }

    public Form setContent(String content) {
        this.content = content;
        return this;
    }

    @Override
    public String toString() {
        return writeToJson(this, true);
    }


    /**
     * Form 子类的的内部类继承,以便 Form 子类的内部类的 toString被重写
     */
    public static class InnerClass {
        @Override
        public String toString() {
            return writeToJson(this, true);
        }

    }
}
